package com.example.springcloudwinter.dto;

public class ResultEntity<T>{
    private T detail;
    private int code;
    //400失败
    //200成功
    //501手机格式错误
    //502手机已经注册
    //601未能查询到该订单
    //602订单已支付

    public ResultEntity<T> setSuccess(){
        code=200;
        return this;
    }

    public ResultEntity<T> setSuccess(T detail){
        code=200;
        this.detail=detail;
        return this;
    }

    public ResultEntity() {
        detail=null;
        code=400;
    }

    public T getDetail() {
        return detail;
    }

    public ResultEntity<T> setDetail(T detail) {
        this.detail = detail;
        return this;
    }

    public int getCode() {
        return code;
    }

    public ResultEntity<T> setCode(int code) {
        this.code = code;
        return this;
    }
}
